<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Secondary Tables Source</title>
</head>
<body>
  <pre class="brush: java">
//Package declaration and imports ommited for brevity
@Entity(name="SecondaryTableEmployee")
@Table(name="basic_sec_tab_emp")
@SecondaryTables({
  @SecondaryTable(name="basic_sec_tab_emp_phone"),
  @SecondaryTable(name="basic_sec_tab_emp_email", 
    pkJoinColumns=@PrimaryKeyJoinColumn(name="emp_id"))
})
public class Employee implements Serializable {
	private int id;
	private String name;
	private String landlineNumber;
	private String mobileNumber;
	private String officeEmail;
	private String personalEmail;
	
	public Employee() {}

	public Employee(String name, String landlineNumber,
    String mobileNumber, String officeEmail,
    String personalEmail) {
		this.name = name;
		this.landlineNumber = landlineNumber;
		this.mobileNumber = mobileNumber;
		this.officeEmail = officeEmail;
		this.personalEmail = personalEmail;
	}

	@Id @GeneratedValue
	public int getId() {
		return id;
	}

	private void setId(int id) {
		this.id = id;
	}

	@Column(nullable = false, length = 30)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Column(table = "basic_sec_tab_emp_phone",
    nullable = false, length = 10)
	public String getLandlineNumber() {
		return landlineNumber;
	}

	public void setLandlineNumber(String landlineNumber) {
		this.landlineNumber = landlineNumber;
	}

	@Column(table = "basic_sec_tab_emp_phone",
    nullable = false, length = 10)
	public String getMobileNumber() {
		return mobileNumber;
	}

	public void setMobileNumber(String mobileNumber) {
		this.mobileNumber = mobileNumber;
	}

	@Column(table="basic_sec_tab_emp_email",
    nullable = false, length = 30)
	public String getOfficeEmail() {
		return officeEmail;
	}

	public void setOfficeEmail(String officeEmail) {
		this.officeEmail = officeEmail;
	}

	@Column(table="basic_sec_tab_emp_email",
    nullable = false, length = 30)
	public String getPersonalEmail() {
		return personalEmail;
	}

	public void setPersonalEmail(String personalEmail) {
		this.personalEmail = personalEmail;
	}
}
  </pre>    
</body>
</html>
